﻿using System;
using System.Runtime.Serialization;
namespace frag_boardgame
{
    public enum ShootingOptionsEnum { Hit, Miss, CantShoot, PlayerKilled, GameOver };
    public enum Direction { Left, Right, Up, Down }

    public enum GameState
    {
        /// <summary>
        /// Game is waiting to start
        /// </summary>
        Waiting,

        /// <summary>
        /// Players setup (positions on the board etc.)
        /// </summary>
        Setup,

        /// <summary>
        /// Game has started
        /// </summary>
        Started,

        /// <summary>
        /// Game is over
        /// </summary>
        Finished
    }


    /// <summary>
    /// This struct is representing a possition.
    /// to check if it hasnt been initilized we must check the value of its field
    /// because it cannot be null.  an empty possiton will be representing by [-1,-1]
    /// </summary>
    [DataContract]
    public class Pos
    {


        [DataMember]
        public int row;
        
        [DataMember]
        public int col;


        public Pos(int row, int col)
        {
            this.row = row;
            this.col = col;
        }

        // override object.Equals
        public override bool Equals(object obj)
        {
            Pos other = obj as Pos;
            if (other == null) return false;

            return (row.Equals(other.row) && col.Equals(other.col));
        }

        // override object.GetHashCode
        public override int GetHashCode()
        {
            return row.GetHashCode() ^ col.GetHashCode();
        }

    }
}

